package org.security.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

/**
 * @author jt
 * @date 2024/7/21 0:24
 */

@AllArgsConstructor
public enum  CustomExceptionType {

    USER_INPUT_ERROR(400, "您输入的数据错误或您没有权限访问资源！"),
    REQUEST_ERROR(400, "请求异常！"),
    TOKEN_ERROR(400,"检查token"),
    UNAUTHORIZED(401,"Unauthorized"),
    NOT_FOUND(404, "资源没找到"),
    SYSTEM_ERROR(500, "系统出现异常，请您稍后再试或联系管理员！"),
    USERORPASS_ERROR(501,"账号密码错误"),
    //资源拒绝访问
    FORBIDDEN(2403, "没有权限访问当前资源"),

    USER_NOT_FOUND(2404, "账号不存在"),

    //用户名或密码不正确
    USER_PASS_NOT_CORRECT(2405, "用户名或密码不正确"),

    USER_STATUS_UN_NORMAL(2406, "账号状态不正常"),

    USER_NOT_DUPLICATE(2407, "账号已存在"),

    OTHER_ERROR(999, "系统出现未知异常，请联系管理员！");

    @Getter
    private String desc;//异常类型中文描述

    @Getter
    private int code; //code

    //构造方法
    CustomExceptionType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    //get set方法
    public String getDesc() {
        return desc;
    }

    public int getCode() {
        return code;
    }


}
